<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>邀请好友制作</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<meta content="yes" name="apple-mobile-web-app-capable">
	<meta content="yes" name="apple-touch-fullscreen">
	<meta content="telephone=no,email=no" name="format-detection">
	<script type="text/javascript" src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/js/jisuan.js"></script>
	<link rel="stylesheet" type="text/css" href="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/css/photoNewBook/invitefellow.css"/>
	</head>
	<body>
		<div class="mian">
			<div class="head">
				<span>书本制作成员</span>
				<a href="{:U('WebApp/PhotoBooks/supervise',array('photoBookId'=>$photoBookId))}">编辑</a>
			</div>
			<div class="two">
				<div class="erWeiMa" data-url="{$photoBookId}"></div>
			</div>
			<div class="soma">扫描上方二维码可邀请好友编辑本书本</div>
			<a href="{:U('WebApp/index/index')}" class="foot">
				完成邀请
			</a>
		</div>
	</body>
</html>
<script type="text/javascript" src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/js/photoNewBook/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/js/qrjs2.min.js"></script>
<script type="text/javascript">
	window.onload=function(){
			tobecode();
	}
				/*
				 *网址变二维码
				 */
//				console.log(111);
				function tobecode(){
				    $(".erWeiMa").each(function(){
				        var photoBookId = $(this).data("url");
                        console.log(photoBookId)
				        erweima(photoBookId,this);


				    })
				}
				
				function erweima(photoBookId,obj){
				 var newurl= "http://www.youyiku-yishu.cn/WebApp/PhotoBooks/inviteFriend.html?photoBookId="+photoBookId;
				    createErweima(newurl,obj);
				    //需要qrjs2.min.js
				    function createErweima(newurl,obj){
				        //console.log(url,obj);
				        var container1 = $(obj);
				        var svgElement = document.createElement("div"),
				
				            u = newurl,
				            s = QRCode.generateSVG(u, {
				                ecclevel: "M",
				                fillcolor: "#FFFFFF",
				                textcolor: "#373737",
				                //						margin: 4,
				                //						modulesize: 4
				            });
				           svgElement.appendChild(s);
       					   container1.append(svgElement);
				       }	
				   }
				
		
</script>